package test1.service;

import test1.extobject.MyObject;

/**
 * @author Merlin
 * @Title: Service
 * @ProjectName 02 第二章
 * @Description: TODO
 * @date 2018/6/2215:50
 */
public class Service {


    public void testMethod1(MyObject object){
        synchronized (object){
            try {
                System.out.println("testMethod1______getLock time=" + System.currentTimeMillis()
                        + " run ThreadName= " + Thread.currentThread().getName());
                Thread.sleep(2000);
                System.out.println("testMethod1______getLock time=" + System.currentTimeMillis()
                        + " run ThreadName= " + Thread.currentThread().getName());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }

    }
}
